package cn.fjson;

import com.alibaba.fastjson.JSON    ;

import java.util.Date;

public class TestJson {

    public static void main(String[] args) {
        //创建java对象
        User user = new User(11,"李四",18,new Date());
        //JSON.toJsonString()
        String jstr = JSON.toJSONString(user);
        System.out.println(jstr);
        User us =  JSON.parseObject(jstr,User.class);
        System.out.println(us.toString());
    }
}
